#include <stdio.h>
#include <stdlib.h>

int
main(void)
{
	int depth = 0;
	int c = 0;

	while (c = fgetc(stdin), c != EOF && (c == '(' || c == ')')) {
		if (c == '(')
			depth++;
		if (c == ')')
			depth--;
		if (depth < 0)
			break;
	}
	if (depth != 0)
		printf("NO\n");
	else
		printf("YES\n");
	return 0;
}
